package com.area.cth.validation;

import com.area.cth.anno.DealState;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class DealStateValidation implements ConstraintValidator<DealState, String> {
    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        if (s == null) {
            return false;
        }
        if (s.equals("未发货") || s.equals("发货中") || s.equals("已完成")) {
            return true;
        }
        return false;
    }
}
